package com.example.demo.system.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.example.demo.annotation.HisDataSave;
import com.example.demo.entity.DictEntity;
import com.example.demo.entity.FileEntity;
import com.example.demo.entity.LoginEnity;
import com.example.demo.entity.LoginRole;
import com.example.demo.entity.MenuEntity;
import com.example.demo.entity.Organization;
import com.example.demo.entity.Person;
import com.example.demo.entity.base.TreeEntity;

@Repository
public interface SystemManageDao {
	int refreshSuperAuthor();
	
	@HisDataSave
	int deleteMenu(@Param("menu_id")String menu_id);
	
	int recordFileInfo(FileEntity fileEntity);
	
	int addMenu(MenuEntity menuEntity);
	
	int updateRole(LoginRole loginRole);
	
	int deleteRoleMenuRelation(MenuEntity menuEntity);
	
	int deleteRole(@Param("role_id")String role_id);
	
	int setRoleMenuRelation(@Param("role_id")String role_id,@Param("menu_id")String menu_id);
	
	int addRole(LoginRole loginRole);
	
	int updatePersonInfo(Person person);
	
	int updateLoginInfo(LoginEnity loginEntity);
	
	int deleteRoleInfo(@Param("login_id")String login_id);
	
	int deletePersonInfo(@Param("login_id")String login_id);
	
	int deleteLoginInfo(@Param("login_id")String login_id);
	
	int addUserRole(LoginRole loginRole);
	
	int addUserPerson(Person person);
	
	int addUserLogin(LoginEnity loginEntity);
	
	@HisDataSave
	int updateMenu(MenuEntity menuEntity);
	
	int deleteOrg(Organization organization);
	
	int addOrg(Organization organization);
	
	int updateOrg(Organization organiztion);
	
	int addDict(DictEntity dictEntity);
	
	int deleteDict(@Param("word_code")Integer word_code);
	
	int updateDict(DictEntity dictEntity);
	
	int updateTypeCode(DictEntity dictEntity);
	
	List<String> getRoleMenuRelation(@Param("role_id")String role_id);
	
	List<Map<String, Object>> getOrganizationNode(@Param("parent_id")String parent_id);
	
	List<TreeEntity> getMenuTreeNode(@Param("parent_id")String parent_id);
	
	List<LoginRole> getAllRoles(LoginRole loginRole);
	
	List<LoginEnity> queryLoginList(LoginEnity loginEntity);
	
	List<MenuEntity> queryMenuList(MenuEntity menuEntity);
	
	List<Organization> queryOrgList(Organization organization);
	
	Integer validDictCode(@Param("word_code")Integer word_code);
	
	List<DictEntity> queryDictList(DictEntity dictEntity);
}
